﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<ThietBiSo.LinQDB.Slider>" %>
<%@ Import Namespace="ThietBiSo.LinQDB" %>
<%@ Import Namespace="ThietBiSo.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
      Website - bảng điều khiển
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="100%" cellpadding="2" cellspacing="0" border="0">
        <tr>
            <td>
               <table width="100%">
                    <tr>
                        <td>
                            <%= Html.ActionLink("Thêm Hình", "Create",null, new { @class = "classThem" })%>
                        </td>
                        <td style="color:Red">
                        Kích thước hình: (1000 x 300) là tốt nhất. Có đuôi (*.jpg, *.jpeg, *.gif)
                        </td>
                        <td align="right">
                            <%: Html.ActionLink("Quay lại", "quantri", "Admin", null, new { @class = "" })%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table id="bang_admin" class="tbl colorize" width="100%" border="0">
                    <tbody>
                        <tr>
                            <th align="center" width="20px">
                                TT
                            </th>
                            <th align="center" width="50">
                                Hinh
                            </th>
                            <th align="center" width="200">
                                Url Images
                            </th>
                            <th width="10">
                                Hiển<br />
                                thị
                            </th>
                            <th align="right" width="30">
                                Xóa
                            </th>
                        </tr>
                    </tbody>
                    <tbody>
                        <% foreach (Slider sp in (List<Slider>)ViewData["Sliders"])
                           {               
                        %>
                        <tr class="tb_hienthi">
                            <td align="center" valign="middle">
                                <input type="text"disabled="disabled" style="width: 20px" autocomplete="off" class="orderbox" value="<%:sp.ThuTu %>"
                                    maxlength="4" id="thutu" />&nbsp;
                                <%:Html.Hidden("MaSPHidden",sp.MaSlider) %>
                            </td>
                            <td>
                                <a href="<%=Url.Action("Edit","slide", new { id = sp.MaSlider } ) %>">
                                    <%if (sp.TenHinh == "" || sp.TenHinh == null || sp.TenHinh == "noImage")
                                      {%>
                                    <img src="<%:Url.Content("~/Content/images/nophoto.gif")%>" alt="" width="500px"
                                        height="100px" />
                                    <%}
                                      else
                                      { %>
                                    <img src="<%: sp.TenHinh%>" alt=""
                                        width="600px;" height="100px;" />
                                    <%} %>
                                </a>
                            </td>
                            <td align="left" style="width:100px">
                                <a style="text-decoration: none;" href="<%=Url.Action("Edit","slide", new { id = sp.MaSlider } ) %>">
                                    <%: sp.TenHinh%>
                                </a>
                            </td>
                            <td align="center">
                                <%if (sp.HienThi == false)
                                  {
                                %>
                                <a href="javascript:capnhat_hienthiSlider(<%:sp.MaSlider%>);">
                                    <input type="checkbox" />
                                </a>
                                <%}
                                  else
                                  {%>
                                <a href="javascript:capnhat_hienthiSlider(<%:sp.MaSlider%>);">
                                    <input type="checkbox" checked="checked" /></a>
                                <%} %>
                            </td>
                            <td align="center">
                                <a href="javascript:Delete_Slider(<%:sp.MaSlider %>);">
                                  <img src="../../Content/imagesAdmin/images/pic_trash.gif" alt="" /></a>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
